package bma.common.thrift.xdom;

public class TDynamicFunction {

	private DynamicThriftManager manager;

	private String name;
	private TDynamicStruct paramStruct;
	private TDynamicStruct returnStruct;
	private boolean oneway;

	public DynamicThriftManager getManager() {
		return manager;
	}

	public void setManager(DynamicThriftManager manager) {
		this.manager = manager;
	}

	public boolean isOneway() {
		return oneway;
	}

	public void setOneway(boolean oneway) {
		this.oneway = oneway;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public TDynamicStruct getParamStruct() {
		return paramStruct;
	}

	public void setParamStruct(TDynamicStruct paramStruct) {
		this.paramStruct = paramStruct;
	}
	
	public void addParam(TDynamicField param) {
		if(this.paramStruct==null) {
			TDynamicStruct s = new TDynamicStruct();
			s.setName(this.name+"_args");
			s.setCallArgs(true);
			s.setCallReturn(false);
			this.paramStruct = s;
		}
		this.paramStruct.addField(param);
	}

	public TDynamicStruct getReturnStruct() {
		return returnStruct;
	}

	public void setReturnStruct(TDynamicStruct returnStruct) {
		this.returnStruct = returnStruct;
	}

}
